package com.example.demo;

/**
 * @Author: wenjingyuan
 * @Date: 2023/08/13/11:06
 * @Description:翻转字符串
 */
public class Test {
    public static String reverse(String a){
        char[] b=a.toCharArray();
        StringBuilder stringBuilder=new StringBuilder();
        for (int i = b.length-1; i >=0; i--) {
            stringBuilder.append(b[i]);
        }
        return stringBuilder.toString();
    }

    public static void main(String[] args) {
        String a="abcde";
        System.out.println(reverse(a));
    }
}
